/**
 * 作者: LDL
 * 说明:
 * 时间: 2015/7/19 14:45
 */
class OOPInScala {

}

class Student(name:String,age:Int,val major:String) extends Person(name,age){
    println("this is the subclasses of Person,major is :"+major)
    override def toString = "Overreded toString method......"
    override val University = "tsinghua"
}
object OOPInScala{
    def main(args: Array[ String ]) {
        val p = new Person("Rocky",22,"male")
        println(p.name+":"+p.age)
        println(p.name+":"+p.gender)
        val s = new Student("Rocky",22,"Computer")
        println(s.toString)
        println(s.University)
    }
}
